//
//  MineViewController.m
//  Share_Home_F
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MineViewController.h"
#import "MineModel.h"
#import "BaseTableViewCell.h"
#import "MineCollectViewController.h"
@interface MineViewController ()
@property (nonatomic, retain)NSMutableArray *arr;
@end

@implementation MineViewController
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = @"我的";
        self.arr = [NSMutableArray arrayWithObjects:@"第三方登录", @"第三方分享", @"我的收藏",@"清除缓存", @"关于我们", @"退出账号", nil];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.tableView registerClass:[BaseTableViewCell class] forCellReuseIdentifier:NSStringFromClass([MineModel class])];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [self.arr count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
    BaseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MineModel class])];
    cell.myLabel.text = self.arr[indexPath.row];
    return cell;
  
    
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
       // 第三方登录
    } else if (indexPath.row == 1) {
        //第三方分享
    } else if (indexPath.row == 2) {
        // 我的收藏
        MineCollectViewController *mineCollect = [[MineCollectViewController alloc] init];
        [self.navigationController pushViewController:mineCollect animated:YES];
        [mineCollect release];
        
        
        
        
    } else if (indexPath.row == 3) {
        // 清除缓存
    } else if (indexPath.row == 4) {
        // 关于我们
    } else if (indexPath.row == 5) {
        
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
